<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctxPath" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <meta name="renderer" content="webkit">
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   <link rel="stylesheet" href="${ctxPath}/static/layui/css/layui.css" />
   <title>用户登录</title>
   <script src="${ctxPath}/static/layui/layui.js"></script>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title" 
		style="margin-top: 20px;">
	    <legend>用户登录页</legend>
	</fieldset>
	
   <form id="userForm" class="layui-form" 
	  action="${ctxPath}/Common/login" method="POST">	  
	  <div class="layui-form-item">
    	 <label class="layui-form-label">用户帐号</label>
		 <div class="layui-input-block" style="width:450px;">
			<input type="text" id="account" 
				name="account" autocomplete="off" 
				placeholder="请输入帐号" 
				class="layui-input">
		  </div>
   	  </div>
   	  
	  <div class="layui-form-item">
    	 <label class="layui-form-label">用户密码</label>
		 <div class="layui-input-block" style="width:450px;">
			<input type="text" id="password" 
				name="password" autocomplete="off" 
				placeholder="请输入密码" 
				class="layui-input">
		  </div>
   	  </div>
   	  
	  <div class="layui-form-item">
    	<div class="layui-input-block">
		    <button type="submit" class="layui-btn">立即提交</button>
    		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
   	  </div>
   </form>
   
<%
String err = request.getParameter("error");
err = (err==null) ? "" : err;
if( "nologin".equals(err) ){
	err = "你没有登录, 请先登录.";
}
%>   
<script>
layui.use( 
	['form', 'layedit', 'laydate'], 
	function(){
		var form = layui.form;
		var layer = layui.layer;
		console.log('{DEBUG} layui.user...');
	}
);
window.onload = function(){	
	var err = '<%=err%>';
	if( err ){
		layer.msg( err );
	}
}
</script>
</body>
</html>